from selenium import webdriver
from time import sleep

from selenium.webdriver import ActionChains
from PIL import Image
import pytesseract
import time
def test01():
    driver = webdriver.Chrome()
    driver.get('http://localhost:8080/jpress/user/register')
    driver.maximize_window()

    pic2 = driver.find_element_by_id('captcha-img').screenshot('01.png')
    sleep(3)
    driver.quit()

def test2():
    img = Image.open('01.png')
    str = pytesseract.image_to_string(img)
    print(str)


test2()